package com.simple.gateway.center.basedata.common;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;

/**
 * 项目: simple-gateway
 * <p>
 * 功能描述:
 *
 * @author: WuChengXing
 * @create: 2023-08-12 18:13
 **/
public class PageUtil {

    public static <O, N> Page<N> convertPage(Page<O> old, List<N> source) {
        Page<N> resPage = new Page<>();
        resPage.setCurrent(old.getCurrent());
        resPage.setSize(old.getSize());
        resPage.setTotal(old.getTotal());
        resPage.setRecords(source);
        return resPage;
    }
}
